home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume14 / mush6.0 / part11 < prev    next >
Encoding:
Internet Message Format  |  1988-04-12  |  34.7 KB

  1. From: island!argv@sun.com (Dan Heller)
  2. Subject: Mail User's Shell, version 6.0
  3.  
  4. #! /bin/sh
  5. # This is a shell archive.  Remove anything before this line, then unpack
  6. # it by saving it into a file and typing "sh file".  To overwrite existing
  7. # files, type "sh file -c".  You can also feed this as standard input via
  8. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  9. # will see the following message at the end:
  10. #        "End of archive 11 (of 14)."
  11. # Contents:  mush.1.a
  12. # Wrapped by rsalz@fig.bbn.com on Wed Apr 13 20:04:54 1988
  13. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  14. if test -f 'mush.1.a' -a "${1}" != "-c" ; then 
  15.   echo shar: Will not clobber existing file \"'mush.1.a'\"
  16. else
  17. echo shar: Extracting \"'mush.1.a'\" \(33606 characters\)
  18. sed "s/^X//" >'mush.1.a' <<'END_OF_FILE'
  19. X.\" Mush Man Page: Copyright (c) 1987 Dan Heller
  20. X.\" Cleaned up January 1988 by Bart Schaefer <schaefer@cse.ogc.edu>
  21. X.\"
  22. X.if n .ds Q \&"
  23. X.if n .ds U \&"
  24. X.if t .ds Q \&``
  25. X.if t .ds U \&''
  26. X.if n .ds - --
  27. X.if t .ds - \(em
  28. X.nh
  29. X.TH MUSH 1 "Dec 21, 1987"
  30. X.UC 4
  31. X.SH NAME
  32. The Mail User's Shell \- Shell for electronic mail.
  33. X.SH SYNOPSIS
  34. X.B mush
  35. X[
  36. X.B \-n
  37. X]
  38. X[
  39. X.B \-v
  40. X]
  41. X[
  42. X.B \-s
  43. subject
  44. X]
  45. X[
  46. X.B \-c
  47. cc-list
  48. X]
  49. X[ address-list ... ]
  50. X.br
  51. X.B mush
  52. X[
  53. X.B \-n
  54. X]
  55. X[
  56. X.B \-i
  57. X]
  58. X[
  59. X.B \-r
  60. X]
  61. X[
  62. X.B \-C
  63. X]
  64. X[
  65. X.B \-N
  66. X]
  67. X[
  68. X.B \-S
  69. X]
  70. X[
  71. X.B \-1
  72. cmd_help
  73. X]
  74. X[
  75. X.B \-d
  76. X]
  77. X[
  78. X.B \-f
  79. X[ folder ]
  80. X]
  81. X.br
  82. X.B mush
  83. X[
  84. X.B \-n
  85. X]
  86. X[
  87. X.B \-i
  88. X]
  89. X[
  90. X.B \-r
  91. X]
  92. X[
  93. X.B \-C
  94. X]
  95. X[
  96. X.B \-N
  97. X]
  98. X[
  99. X.B \-S
  100. X]
  101. X[
  102. X.B \-1
  103. cmd_help
  104. X]
  105. X[
  106. X.B \-d
  107. X]
  108. X[
  109. X.B \-u
  110. X[ user ]
  111. X]
  112. X.br
  113. X.B mush
  114. X[
  115. X.B \-n
  116. X]
  117. X[
  118. X.B \-H[:c]
  119. X]
  120. X.br
  121. X.B mush
  122. X[
  123. X.B \-n
  124. X]
  125. X[
  126. X.B \-t
  127. X]
  128. X[
  129. X.B \-T
  130. timeout
  131. X]
  132. X[
  133. X.B \-1
  134. cmd_help
  135. X]
  136. X[
  137. X.B \-2
  138. tool_help
  139. X]
  140. X[
  141. X.B \-d
  142. X]
  143. X[
  144. X.B \-f
  145. X[ folder ]
  146. X]
  147. X.br
  148. X.B mush
  149. X[
  150. X.B \-n
  151. X]
  152. X[
  153. X.B \-t
  154. X]
  155. X[
  156. X.B \-T
  157. timeout
  158. X]
  159. X[
  160. X.B \-1
  161. cmd_help
  162. X]
  163. X[
  164. X.B \-2
  165. tool_help
  166. X]
  167. X[
  168. X.B \-d
  169. X]
  170. X[
  171. X.B \-u
  172. X[ user ]
  173. X]
  174. X.SH INTRODUCTION
  175. The Mail User's Shell (Mush) is an interface for sending and manipulating
  176. a database of electronic mail messages under the
  177. X.I UNIX
  178. environment.
  179. There are three user interfaces which allow the user to interact with
  180. X.I Mush.
  181. The default interface is the conventional tty-based line mode
  182. similar to command line interpreters such as
  183. X.I csh
  184. as well as other mailers, such as University of California, Berkeley's,
  185. X.I Mail
  186. and Bell Lab's System V
  187. X.I mailx
  188. interface.
  189. This mode requires nothing from the terminal in screen
  190. optimization and may be run on many different versions of the
  191. X.I UNIX
  192. operating system.
  193. X.PP
  194. The text-graphics (curses) interface is reminiscent of the
  195. X.I vi
  196. visual editor, but is user-configurable to simulate other editors.
  197. This interface does not require graphics capabilities of
  198. the computer or the terminal on which it is run, but the terminal must
  199. have the minimum capabilities required by any visual screen editor.
  200. X.PP
  201. The
  202. X.I window
  203. interface for the Sun Workstation utilizes the icon and
  204. menu based (mouse selectable) windowing system.
  205. This
  206. X.I tool
  207. X(graphics), mode is highly subject to the version of operating system
  208. your Sun may be running.
  209. While the program works with variable levels of success on earlier versions, it
  210. is intended to be run on Sun versions 2.0 and higher.
  211. See the BUGS section at the end for more information.
  212. X.PP
  213. See the corresponding sections for more information on the user
  214. interface desired.
  215. Most of this manual deals with commands, variables
  216. and actions which are common to all three interfaces although
  217. some attention is paid to individual characteristics of each interface.
  218. X.PP
  219. The following command line arguments are understood by
  220. X.I Mush:
  221. X.TP
  222. X\-C
  223. Enter the mailer in curses mode upon startup.
  224. X.TP
  225. X\-c cc-list
  226. The list of Carbon Copy recipients is set on the command line.
  227. If more than one address is specified, the entire list should be encased in
  228. quotes.
  229. This applies when sending mail only.
  230. If you are entering the shell, curses mode, or the tool mode, this option is
  231. ignored.
  232. X.TP
  233. X\-d
  234. Turns on the debugging level to 1.
  235. You can change debugging levels from within the shell using the
  236. X.B debug
  237. command.
  238. X.TP
  239. X\-f [ filename ]
  240. The optional filename argument specifies a folder containing mail messages.
  241. With no argument,
  242. X.B mbox
  243. in the current directory (or the variable
  244. X.BR mbox )
  245. is used.
  246. If no filename is given, this option must be last on the command line.
  247. X.TP
  248. X\-H[:c]
  249. Have
  250. X.I Mush
  251. display mail headers without entering the shell.
  252. See the
  253. X.B headers
  254. command for information on the
  255. X.B :c
  256. argument.
  257. No colon modifier is equivalent to \*Q\-H:a\*U.
  258. This option prevents the shell from running, so this option will turn off the
  259. X\-S and \-C flags.
  260. This option is ignored if the tool mode is in effect.
  261. X.TP
  262. X\-i
  263. Forces interactive mode even if input has been redirected to the program.
  264. This is intended for remote host mail sessions but also allows
  265. the user to redirect \*Qscripts\*U of
  266. X.I Mush
  267. commands.
  268. See the INITIALIZATION section for information on how to
  269. write scripts which deal with mail.
  270. Note that this flag is different from the \*Qignore\*U flag of UCB Mail.
  271. X.TP
  272. X\-N
  273. Enter
  274. X.I Mush
  275. without displaying any message headers.
  276. This argument is passed to the
  277. X.B folder
  278. command.
  279. X.TP
  280. X\-n
  281. No initialization is done on start up.
  282. That is, do not source
  283. X.I .mushrc
  284. or
  285. X.I .mailrc
  286. files.
  287. See the INITIALIZATION section for more information on
  288. startup and the significance of these files.
  289. X.TP
  290. X\-r
  291. Initialize the folder in Read-Only mode; no modification of the folder is
  292. permitted.
  293. This argument is passed on to the
  294. X.B folder
  295. command.
  296. X.TP
  297. X\-S
  298. This flag allows the user to enter the shell even if the system
  299. mailbox or specified folder is empty or doesn't exist.
  300. X.TP
  301. X\-s subject
  302. The subject is set on the command line using this flag.
  303. If the subject has
  304. any spaces or tabs, the entire subject should be encased in quotes.
  305. This applies when sending mail only.
  306. If you are entering the shell,
  307. curses mode, or the tool mode, this option is ignored.
  308. X.TP
  309. X\-T timeout
  310. In the tool mode (Sun only),
  311. X.I timeout
  312. specifies the length of time (seconds) to wait between each check for new mail.
  313. X30 seconds is the smallest time allowed for performance reasons.
  314. X60 seconds is the default value.
  315. X.TP
  316. X\-t
  317. Use the graphics tool mode (Sun only).
  318. X.TP
  319. X\-u [ user ]
  320. The mailbox to use is /usr/spool/mail/\fBuser\fR.
  321. If the login name for user is not specified, then root is used.
  322. X.TP
  323. X\-v
  324. Verbose mode is turned on.
  325. This option is passed to the actual mail delivery
  326. subsystem internal to your version of
  327. X.I UNIX.
  328. Some mailers do not have a verbose option, so this flag may not apply
  329. to your system (System V, for example).
  330. This applies when sending mail only.
  331. If you are entering the shell,
  332. curses mode, or the tool mode, this option is ignored.
  333. X.TP
  334. X\-1 cmd_help
  335. X.ns
  336. X.TP
  337. X\-2 tool_help
  338. X.rs
  339. Specify alternate locations of help files.
  340. These should be full pathnames accessible for reading.
  341. This is usually done if a binary copy of
  342. X.I Mush
  343. has been copied from another machine and the wrong pathnames to the
  344. help files cannot be changed.
  345. X.SH FEATURES
  346. X.BR "New Mail" .
  347. X.PP
  348. If during a
  349. X.I Mush
  350. session, new mail arrives for you, it is automatically incorporated into
  351. your system mailbox and you are told that new mail has arrived.
  352. X.PP
  353. In the default line mode, new mail is checked between each command
  354. issued.
  355. In the curses mode, new mail is checked on each
  356. command and is displayed in the bottom line of the screen.
  357. In the tool based graphics mode, new mail is checked approximately
  358. every minute or by the number of seconds specified by the
  359. X.B -T
  360. option on the command line.
  361. X.PP
  362. If you are using your system mailbox as your \*Qcurrent folder,\*U then the
  363. new mail is added immediately to your current
  364. list of messages and the following information is displayed, to tell you
  365. whom the mail is from:
  366. X.sp
  367. X.ti +2
  368. New mail: (#15) island!argv@sun.com (Dan Heller)
  369. X.sp
  370. If you are not in your system mailbox, then the new mail will not be added
  371. to your list of messages, but you will instead be informed of the new arrival.
  372. X.sp
  373. If you are using the tool based mode and
  374. X.I Mush
  375. is closed to an iconic state, then the number of messages in the current
  376. folder is displayed on the mailbox icon and the flag on the mailbox will go up.
  377. X.PP
  378. X.BR History .
  379. X.PP
  380. In the line-mode interface,
  381. X.I Mush
  382. supports a history mechanism similar to that supplied by
  383. X.IR csh .
  384. A subset of history modifiers are supported to reference previously
  385. issued commands and to extract specified arguments from these commands.
  386. X.PP
  387. X.BR "Mail Aliases" .
  388. X.PP
  389. Mail aliases are shorthand names for long mail addresses.
  390. These are supported in the same manner as UCB Mail supports them.
  391. Because
  392. X.I Mush
  393. has command line history reminiscent of
  394. X.IR csh ,
  395. commands which use UUCP's `!' character for user-host and host-host
  396. separation should be escaped (preceded by a backslash).
  397. This is not necessary in the initialization file (.mushrc) because history
  398. referencing is ignored while these files are being sourced.
  399. See the INITIALIZATION and LINE-MODE INTERFACE sections for more
  400. information on initialization file format and the history mechanism.
  401. X.PP
  402. Aliases reference normal mailing addresses as well as other aliases.
  403. If a loop is detected, then the user will be notified and the message will
  404. be forced into the file
  405. X.B dead.letter
  406. in the user's home directory.
  407. The
  408. X.B unalias
  409. command is used to reverse the effects of the
  410. X.B alias
  411. command.
  412. X.PP
  413. X.BR "Command Line Aliases" .
  414. X.PP
  415. Command aliases are different than mail aliases in that they are used
  416. to expand to commands.
  417. The usage of command line aliases is similar to that supplied by
  418. X.IR csh .
  419. X.sp
  420. X.PP
  421. X.BR "Command Pipes" .
  422. X.PP
  423. X.I Mush
  424. commands can be \*Qpiped\*U to one another so as to provide output of
  425. one command to be used as input to the next command in the pipeline.
  426. However, the output of commands is not the \*Qtext\*U that is returned
  427. X(as it is in
  428. X.IR csh ),
  429. but the messages that are affected.
  430. X.PP
  431. X.BR Help .
  432. X.PP
  433. X.I Mush
  434. was designed so that each command or action should not be a mystery.
  435. Helping the user understand what to do and how to do whatever he wishes
  436. is the goal behind the help facility.
  437. For this reason, the
  438. X.B help
  439. command gives information on both general usage and specific help categories.
  440. X.PP
  441. In text mode, most help is gotten by typing \-? as an argument to a
  442. command.
  443. Virtually every command has the \-? option.
  444. When this option is specified, most commands will attempt to read from a help
  445. file the necessary information explaining the functionality of the command.
  446. If necessary, a pointer to other sources of information will
  447. be given to fully explain a concept.
  448. X.PP
  449. In the curses mode, the `?' key will display a list of the current
  450. command-to-key bindings; a keystroke or set of keystrokes correspond
  451. directly to a command.
  452. X.PP
  453. In the tool/graphics mode, this is
  454. also available, but more extensive help is provided in the pop-up menus.
  455. Pop-up menus can be gotten from virtually anywhere on the screen; press the
  456. RIGHT mouse button (the \*Qmenu button\*U) and a number of items will appear
  457. in a menu.
  458. The last command in the menu list will be one labelled \*Qhelp\*U.
  459. Selecting this menu item will display a \*Qhelp box\*U in the center of the
  460. console and wait for input to remove the box.
  461. X.PP
  462. X.BR "Sorting mail" .
  463. X.PP
  464. X.I Mush
  465. allows you to sort your mail according to various constraints such
  466. as time, status (new, unread, deleted, etc), by author and subject.
  467. See the
  468. X.B sort
  469. command in the COMMANDS section for more information on sorting.
  470. X.PP
  471. X.B Picking specific messages.
  472. X.PP
  473. You can select messages that contain unique information, or from
  474. messages that have special attributes.
  475. You have the option of restricting your search to messages between dates,
  476. message numbers, author names and other constraints.
  477. X.SH INITIALIZATION
  478. After the command line arguments have been interpreted, if the argument
  479. X.B -n
  480. is not given,
  481. X.B Mush
  482. will read commands from an
  483. X.B "initialization file"
  484. that (typically) sets variable values, aliases, command line aliases,
  485. and so forth.
  486. The default system initialization file is read first and then the
  487. user's personal initialization file is read.
  488. The system default file
  489. is set up by the system administrator and may contain commands which
  490. should be set system-wide.
  491. X.PP
  492. The user's file is determined by first looking for the environment variable
  493. X.IR MAILRC .
  494. If that file isn't found, then the file
  495. X.I .mushrc
  496. is searched for in the home directory of the user.
  497. If that file cannot be found, it will attempt to read the file,
  498. X.I .mailrc
  499. from the same directory.
  500. Finally, if that file cannot be read, no initialization is done
  501. and the default values will be in effect.
  502. X.PP
  503. If the user has no home directory, or permissions prevent read/write access
  504. to $HOME, /tmp is used as the home directory.
  505. See the
  506. X.B home
  507. variable under the VARIABLES section.
  508. X.PP
  509. Once in the shell, the
  510. X.B source
  511. command may be used to specify a file if you want to read commands from
  512. a specific file other than the default.
  513. The command
  514. X.B saveopts
  515. will save all variable settings, aliases, and all other
  516. X.I Mush
  517. settable attributes, to aid in creating an initialization file.
  518. If no filename is given on the command line,
  519. the
  520. X.B source
  521. and
  522. X.B saveopts
  523. commands choose a file in the manner described above.
  524. X.B Saveopts
  525. will not overwrite the file if it exists.
  526. In such cases, you will be prompted to confirm overwrite.
  527. If you confirm overwriting the existing file, remember that existing \*Qif\*U
  528. expressions or other manually entered comments or non variable-setting type
  529. commands that previously existed in the file will be lost.
  530. X.PP
  531. No interactive commands should be called from any initialization file.
  532. These commands are not prevented because it is impossible to trace which
  533. commands may be UNIX commands that are interactive.
  534. The responsibility of not running interactive commands is left to the user.
  535. Because the initialization file is read
  536. X.I before
  537. any messages are read into the program,
  538. message filtering commands should not be placed in this file unless you know
  539. you're going to
  540. X.IB re- source
  541. the file later as a command.
  542. X.PP
  543. X.IR "Initialization File Format" .
  544. When reading the initialization file,
  545. X.I Mush
  546. will recognize the `#' character as a comment character.
  547. It may be anywhere on a line in the file.
  548. When that character is encountered,
  549. processing of that line is discontinued to the end of the line.
  550. If the `#' is encased in quotes (single or double), then it is not
  551. considered a comment.
  552. Examples:
  553. X.sp
  554. X.ti +2
  555. set shell = /bin/csh  # set the shell variable
  556. X.ti +2
  557. X# this entire line has been commented out.
  558. X.ti +2
  559. set prompt = "Message #%m: "  # The `#' is within quotes
  560. X.PP
  561. The
  562. X.B exit
  563. command has special meaning in the initialization file.
  564. If the command is found,
  565. X.I Mush
  566. will not exit, but rather, discontinue reading from the file immediately.
  567. X.PP
  568. There may be \*Qif\*U expressions within the initialization file to determine
  569. certain runtime states of
  570. X.I Mush.
  571. There are no parentheses allowed and only one boolean expression may be
  572. evaluated per line; that is, no \*Q&&\*U or \*Q||\*U may be used in
  573. expressions.
  574. There is currently no support for multiple levels of if-else expressions
  575. and embedded \*Qif\*U expressions are ignored (they are evaluated to TRUE).
  576. There must always be an \*Qendif\*U matching each \*Qif\*U expression.
  577. The statements associated with an \*Qif\*U expression are never on the same
  578. line with the conditional.
  579. X.PP
  580. Conditional expressions understood include the internal variables,
  581. X.IR istool ,
  582. X.IR iscurses ,
  583. X.IR hdrs_only ,
  584. X.IR is_sending ,
  585. and
  586. X.IR redirect .
  587. If
  588. X.I istool
  589. is true, the program is going to run in the tool mode.
  590. If
  591. X.I iscurses
  592. is true, the program is in or is going to run in the curses mode even
  593. though the screen package may not yet have been started.
  594. If
  595. X.I hdrs_only
  596. is true, then the -H flag on the command line has been given.
  597. If
  598. X.I is_sending
  599. is true, then the user is sending mail to a user.
  600. This does not imply
  601. that the user is not going to be running a shell after the mail is sent.
  602. If
  603. X.I redirect
  604. is true, then input to the program is redirected.
  605. The test for redirection tells whether input, not output, has been
  606. redirected to the program.
  607. The
  608. X.B \-i
  609. option on the command line is required to run the shell if redirect is on.
  610. If \-i is specified, the value for
  611. X.I redirect
  612. will be set to false.
  613. These are internal variables whose values can not be referenced using the
  614. X\*Q$variable\*U method of variable expansion.
  615. X.PP
  616. The `!' operator may be used to negate expressions, thus,
  617. X.sp
  618. X.nf
  619. X.in +2
  620. if !istool
  621. X.ti +4
  622. exit
  623. else
  624. X.ti +4
  625. set autoprint
  626. endif
  627. X.in -2
  628. X.fi
  629. X.sp
  630. means that if you are not running as a tool, stop reading commands from this
  631. file.
  632. Otherwise, set the autoprint variable.
  633. X.sp
  634. X.in +2
  635. X.nf
  636. set hdr_format = "%25f %7d (%l/%c) %25s"
  637. if hdrs_only
  638. X.ti +4
  639. exit
  640. endif
  641. X.in -2
  642. X.fi
  643. X.sp
  644. This tells the program to set the hdr_format variable and check to see if
  645. we're running the program to read headers only.
  646. If so, stop reading this file (exit) and continue on with the program.
  647. This speeds up runtime quite a bit for those who have lengthy initialization
  648. files, because no other shell variables are necessary.
  649. X.sp
  650. X.in +2
  651. X.nf
  652. if !iscurses
  653. X.ti +4
  654. set crt = 24 screen = 18
  655. endif
  656. X.in -2
  657. X.fi
  658. X.sp
  659. This segment checks to see that we're not running in curses mode, and if not
  660. it will set our crt and screen sizes.
  661. This is mostly because the curses mode will set those values for us by looking
  662. at the size of the screen.
  663. Like other interactive commands, the
  664. X.B curses
  665. command itself should never be called from an initialization file.
  666. Doing so will cause terminal settings to be set incorrectly and unpredictable
  667. results from there.
  668. See the CURSES INTERFACE section for configuring your
  669. environment so you enter curses mode each time you run the shell.
  670. X.PP
  671. String evaluation is allowed in \*Qif\*U expressions, and the operators
  672. X\*Q==\*U and \*Q!=\*U may be used to determine equality or inequality.
  673. Usually, variables are compared with constants for evaluation.
  674. X.sp
  675. X.in +2
  676. X.nf
  677. if $TERM == adm3a
  678. X.ti +4
  679. set pager = more
  680. else
  681. X.ti +4
  682. set pager = less
  683. endif
  684. X.in -2
  685. X.fi
  686. X.sp
  687. This segment tests to see if the user's terminal type is \*Qadm3a\*U.
  688. If it is, then it sets the pager variable to be the 
  689. X.I more
  690. program.
  691. Note that the variable TERM will be gotten from the user's environment if a
  692. shell variable is not set already.
  693. Otherwise, the pager variable is set to \*Qless\*U.
  694. This exemplifies the fact that
  695. X.I less
  696. normally fails to function correctly
  697. for the terminal type \*Qadm3a\*U so we don't use it.
  698. X.PP
  699. After sourcing the initialization file,
  700. X.I Mush
  701. reads all the mail out of the specified folder (the system spool directory
  702. if no folder is given) and creates a list of messages.
  703. The current maximum number of messages the user
  704. can load is set to 1000 by default.
  705. The system administrator who configures the program can reset this
  706. value higher or lower if you ask nicely.
  707. If the user has the
  708. X.B sort
  709. variable set, then when the current folder's messages have all been read,
  710. the messages are sorted according to the value of the
  711. variable (see the sort entry under the VARIABLES heading for more information).
  712. Each message has a number of message header lines which contain information
  713. about whom the mail is from, the subject of the message, the date it was
  714. received, and other information about the letter.
  715. This information is then compiled into a one-line summary for
  716. each message and is printed out in an appropriate manner
  717. depending on the interface you're using.
  718. X.PP
  719. At this point, commands may be input by the user.
  720. Lengthy or complex commands can be placed in a file and then executed via the
  721. X.B source
  722. command; for example, a filtering file, "filter", might contain:
  723. X.sp
  724. X.in +2
  725. X.nf
  726. pick -f Mailer-Daemon | save mail_errors
  727. pick -f yukko | delete
  728. pick -s -i thesis | save +thesis_mail
  729. pick -t unix-wizards | +wizmail
  730. update
  731. sort d
  732. X.in -2
  733. X.fi
  734. X.sp
  735. Then the first command the user typed might be \*Qsource filter\*U
  736. and the following would happen:
  737. First, all messages that have \*QMailer-Daemon\*U in the from line
  738. will be saved in the file mail_errors.
  739. Then, all mail from the user \*Qyukko\*U will simply be deleted.
  740. Next, all mail that has in the subject field \*Qthesis\*U
  741. X(case ignored, so \*QThesis\*U would also match) would be
  742. saved in the file $folder/thesis.
  743. The next command will find all messages that are addressed to
  744. the group \*Qunix-wizards\*U (of which the user is an elite
  745. member) and save them in the file $folder/wizmail.
  746. Last, the folder will be updated, removing all deleted mail
  747. X(saved mail may be marked as deleted),
  748. and the folder is reread and sorted according to the date of the messages.
  749. X.SH "GENERAL USAGE"
  750. Because there are three different interfaces available to the user,
  751. the tty characteristics (backspace, kill-word, kill-line, redraw line)
  752. are simulated identically in all interfaces.
  753. When the user has to type something, the 4.2BSD style of tty driver interface
  754. is simulated whether you're in the window system, the curses mode, the tty-line
  755. mode, and even on System-V machines.
  756. This means that backspacing causes a
  757. backspace-space-backspace effect (erasing the character backspaced over).
  758. The user may reset his tty characteristics using the stty command.
  759. X.PP
  760. X.IR "Displaying messages" .
  761. X.PP
  762. Depending on the interface you use, you can display any message in your
  763. list of messages as long as the message is not marked for deletion.
  764. If the message is marked as deleted, then use the 
  765. X.B undelete
  766. command supplied by the interface you are using.
  767. To display a message in line mode, specify a message to be displayed using
  768. X.BR print ,
  769. X.BR type ,
  770. X.BR p ,
  771. X.BR t ,
  772. or by typing the message number, that message will be printed on the screen.
  773. X.PP
  774. In curses mode, move the cursor over the message you want and type
  775. a `t' or `p' to read the message.
  776. The user may \*Qbind\*U other keys to call
  777. the function which displays messages if `t' and `p' are uncomfortable.
  778. X.PP
  779. In the graphics mode, move the mouse over the message you wish to
  780. be displayed and select the LEFT mouse button.
  781. If the message you want is not visible (in the header subwindow), you may type
  782. in the message subwindow the number of the message and hit return.
  783. That message number will be displayed.
  784. X.PP
  785. In the line or curses mode, if the message has more lines than the variable
  786. X.BR crt ,
  787. then a
  788. X.I pager
  789. will be invoked to allow the user to page through the message without
  790. having it scroll off the screen.
  791. The pager used is determined by the variable
  792. X.BR pager .
  793. If that variable is unset, then a default pager will be used.
  794. Note that if pager is set, but not to a value, or is set to the value
  795. of \*Qinternal\*U, then the internal pager is used.
  796. The internal pager
  797. is very simple; the spacebar displays the next
  798. X.B crt
  799. lines, carriage return prints the next line, and \*Qq\*U quits the pager.
  800. X.PP
  801. In the tool mode, if a message is larger than the size of the message
  802. subwindow, the amount of the message viewed is displayed and the user
  803. may page through the message via `+' (forward by lines), `-' (backwards
  804. by lines), LEFT mouse button (forward by pages), or RIGHT mouse button
  805. X(backwards by pages).
  806. The user may precede the `+' and the `-' keystrokes with a numerical
  807. X.I count
  808. to specify how many lines to scroll.
  809. X.PP
  810. An alternative to displaying messages is the
  811. X.B top
  812. command.
  813. This command will print just the top few lines of a message.
  814. The number of lines is determined by the variable
  815. X.BR toplines .
  816. If this variable isn't set,
  817. X.B top
  818. will print a number of lines equal to the value of the variable
  819. X.BR crt .
  820. X.PP
  821. X.IR "Sending mail" .
  822. X.PP
  823. You can send mail using the
  824. X.B mail
  825. command or by responding to other mail.
  826. In either case, when you are sending mail, you are in a mode where everything
  827. you type is added to the contents of the message.
  828. When you are done typing your message, you can type `^D' to signify the end of
  829. the message.
  830. If you have the variable
  831. X.B dot
  832. set, then you can end a message with a `.' on a line by itself.
  833. X.PP
  834. While you are composing a message,
  835. X.I Mush
  836. treats lines beginning with the character `~' specially.
  837. This is called a
  838. X.B tilde escape.
  839. For instance, typing \*Q~i\*U (alone on a line) will place a copy
  840. of the \*Qcurrent message\*U into your message body.
  841. It will not include the message headers of the message, just the body of text
  842. which composes the message.
  843. X.PP
  844. Available
  845. X.BR "tilde escapes" :
  846. X[OPTIONAL arguments in square brackets]
  847. X.TP
  848. X~a file
  849. Append message buffer to file name.
  850. X.TP
  851. X~b [bcc list]
  852. Modify blind carbon recipients; otherwise identical to ~t.
  853. X.TP
  854. X~c [cc list]
  855. Modify carbon copy recipients; otherwise identical to ~t.
  856. X.TP
  857. X~E[!]
  858. Erase message buffer.
  859. Save the contents of the letter to \*Qdead.letter\*U
  860. X(unless the `!' is specified) and then clear the message buffer; the user
  861. remains in editing mode.
  862. If the variable,
  863. X.B nosave
  864. is set, then `!' need not be specified.
  865. X.TP
  866. X~e [editor]
  867. Enter the editor.
  868. Defaults to variable
  869. X.BR editor ,
  870. environment EDITOR, or
  871. X.IR vi .
  872. X.TP
  873. X~F[!]
  874. Add a fortune [don't add] at end of message.
  875. X.TP
  876. X~f [msg#'s]
  877. Forward mail.
  878. The included messages are not indented,
  879. but are marked as \*Qforwarded mail\*U.
  880. X.TP
  881. X~H [msg#'s]
  882. Same as ~i, but also include the message headers.
  883. X.TP
  884. X~h
  885. Modify all message headers.
  886. Each header is displayed one by one and each may be edited.
  887. X.TP
  888. X~i [msg#'s]
  889. Include current message body (or numbered messages).
  890. See the descriptions of the variables
  891. X.BR indent_str ,
  892. X.BR pre_indent_str ,
  893. and
  894. X.BR post_indent_str .
  895. X.TP
  896. X~p [pager]
  897. Page the message body.
  898. Defaults to variable
  899. X.BR pager ,
  900. environment PAGER, or the default pager set up by the system administrator.
  901. This may be the internal pager.
  902. X.TP
  903. X~q
  904. Quit message; save in ~/dead.letter if
  905. X.B nosave
  906. is not set.
  907. X.TP
  908. X~r file
  909. Read filename into message buffer.
  910. X.TP
  911. X~S[!]
  912. Include [don't include] signature at end of message.
  913. The variables,
  914. X.B autosign
  915. and
  916. X.B autosign2
  917. describes the file or string to append to the message.
  918. See the VARIABLES section for more information on these variables.
  919. X.TP
  920. X~s [subject]
  921. Modify the subject header.
  922. If an argument is given (a new subject), then the subject line is
  923. X.I replaced
  924. by the new subject line.
  925. If none is given, then the subject line is
  926. displayed for editing just as in the ~t command.
  927. X.TP
  928. X~t [list]
  929. Change list of recipients (\*QTo\*U list).
  930. If a list is given, this list is
  931. X.B appended
  932. to the current list.
  933. If no list is given, then the current list
  934. is displayed and the cursor placed at the end of the list.
  935. You can backspace over the stuff in the list or you can append more
  936. addresses onto the end of the list as desired.
  937. System-V users
  938. may only replace the line, retyping it if necessary, to append new
  939. users; specifying a list on the tilde line is recommended in this case.
  940. X.TP
  941. X~u
  942. Up one line.
  943. If the user made a mistake typing a letter and he
  944. has already hit carriage return, he may avoid entering the editor
  945. and edit the previous line using ~u.
  946. The line is retyped and
  947. the cursor is placed at the end allowing the user to backspace
  948. over it and retype the line.
  949. System-V users should note that if
  950. the new line is shorter than it was before the ~u command, the
  951. line is padded with blanks to the previous length of the file.
  952. X.TP
  953. X~v [editor]
  954. Enter the visual editor.
  955. Defaults to variable
  956. X.BR visual ,
  957. environment VISUAL, or
  958. X.IR vi .
  959. X.TP
  960. X~w file
  961. Write message buffer to file name.
  962. X.TP
  963. X~x
  964. Exit message; don't save in dead.letter.
  965. X.TP
  966. X~$variable
  967. Insert the string value for variable into message.
  968. If a boolean variable is listed, nothing is appended regardless of its value.
  969. X.TP
  970. X~:command
  971. Run the
  972. X.I Mush
  973. command specified by \*Qcommand\*U.
  974. You may not run any command which sends mail.
  975. It is inadvisable to change folders at this time
  976. since the current message list may be corrupted, but the action is
  977. allowed nonetheless to provide flexibility for experienced users.
  978. X.TP
  979. X~~
  980. A line beginning with two escape characters will be unaffected by
  981. X.I Mush
  982. except that only a single tilde will be inserted into the letter.
  983. X.PP
  984. The variable
  985. X.B escape
  986. may be set to describe a character other than `~' to be used as the
  987. escape character.
  988. When sending mail, the above tilde escapes are available in
  989. all three user interfaces.
  990. X.SH "LINE-MODE INTERFACE"
  991. In the line-mode, the user is given a prompt to which commands are issued
  992. and arguments are passed to commands.
  993. When the user types at the prompt, each line is parsed and words (or,
  994. arguments) are separated into an array of strings.
  995. This array, also called an
  996. X.IR "argument vector" ,
  997. is then modified by expanding history references, command line aliases,
  998. and variable references.
  999. A command line ends when the end of the line is encountered or a pipe (|)
  1000. or semicolon (;) character are encountered, separating discrete commands.
  1001. X.PP
  1002. When a command line has been determined and placed in an argument vector, the
  1003. first argument in the vector (the \*Qcommand\*U) is searched for in a list of
  1004. legal
  1005. X.I Mush
  1006. commands.
  1007. If found, the function associated with that command is called and
  1008. the rest of the line is passed to that function as
  1009. X.IR "command line arguments" .
  1010. X.PP
  1011. Before commands are called, however, the input the user gives is preprocessed
  1012. in a style reminiscent of the C-shell
  1013. X.RI ( csh ).
  1014. X.I Mush
  1015. also supports a subset from each of the following aspects of
  1016. X.IR csh :
  1017. X.in +2
  1018. X\(bu Command history.
  1019. X.br
  1020. X\(bu Command line aliasing.
  1021. X.br
  1022. X\(bu \*QPiping\*U mechanism to
  1023. redirect \*Qinput\*U and \*Qoutput\*U of commands.
  1024. X.in -2
  1025. X.PP
  1026. X.BR "Command history" .
  1027. X.PP
  1028. The history mechanism remembers commands up to the value of the
  1029. X.B history
  1030. variable.
  1031. If this variable is not set, only the most recent command is remembered.
  1032. To reference previously typed commands, the `!' character
  1033. is used in the same manner as in
  1034. X.IR csh .
  1035. There is a limited implementation of history modification;
  1036. supported are the argument selectors which reference
  1037. command line arguments and \*Q:p\*U (echo, but don't execute the command).
  1038. X.sp
  1039. Examples:
  1040. X.nf
  1041. X.in +2
  1042. X.ta 1i
  1043. X!-2:$    two commands ago, last argument.
  1044. X!3:2-4    the third command, arguments two through four.
  1045. X!!:p    print the last command in its entirety.
  1046. X.in -2
  1047. X.fi
  1048. X.PP
  1049. During the sourcing of initialization files (.mushrc), history is not
  1050. in effect and therefore the `!' character does not cause history expansion.
  1051. This includes startup of the program and when the command
  1052. X.I source
  1053. is issued.
  1054. UUCP style addresses that contain the `!' character may be given in the
  1055. initialization file without the need to be preceded by a backslash.
  1056. However, `!' does need to be escaped if
  1057. X.BR cmd 's
  1058. are used to reference command line arguments.
  1059. X.PP
  1060. X.BR "Command line aliasing" .
  1061. X.PP
  1062. This feature enables command substitution similar to
  1063. X.IR csh .
  1064. To be backwards compatible with UCB Mail, the
  1065. X.B alias
  1066. command is used for address aliasing.
  1067. Thus, the command
  1068. X.B cmd
  1069. is introduced in place of
  1070. X.BR alias .
  1071. X.PP
  1072. Examples:
  1073. X.nf
  1074. X.in +2
  1075. cmd d delete
  1076. cmd t type
  1077. cmd dt 'd ; t'
  1078. cmd - previous
  1079. cmd r 'replysender \\!* -e -i'
  1080. X.in -2
  1081. X.fi
  1082. X.sp
  1083. In the last example, if the user types \*Qr 5\*U,
  1084. X.I Mush
  1085. will reply to sender of the fifth message and pass all the other
  1086. arguments along to the
  1087. X.B reply
  1088. command.
  1089. Note the escaping of the `!' character.
  1090. This must also be done if set in the initialization file (.mushrc).
  1091. Had the user not specified a message number on the `r' command line,
  1092. X.B respond
  1093. would reply to the \*Qcurrent message\*U rather than the fifth message.
  1094. X.PP
  1095. X.BR "Piping commands" .
  1096. X.PP
  1097. X\*QOutput\*U from a command is a
  1098. X.BR "message list" ,
  1099. not the
  1100. X.I text
  1101. in a message.
  1102. A
  1103. X.B "message list"
  1104. is defined as the set of messages which the user specifies in a command or
  1105. the messages a command affects after it is through executing.
  1106. When one command is piped to another, the effect is that the second command
  1107. will consider only those messages affected by first command.
  1108. In most cases,
  1109. X.I Mush
  1110. is smart enough to know when piping is occurring and may suppress text output
  1111. that a command might produce.
  1112. X.PP
  1113. Examples:
  1114. X.sp
  1115. X.ti +2
  1116. pick -f fred | save fred_mail
  1117. X.sp
  1118. This will find all the messages from \*Qfred\*U
  1119. and save them all in the file named fred_mail.
  1120. X.sp
  1121. X.ti +2
  1122. lpr 4-8 | delete
  1123. X.sp
  1124. This will send messages 4, 5, 6, 7, and 8 to the printer and then delete them.
  1125. X.sp
  1126. X.ti +2
  1127. headers :o | delete
  1128. X.sp
  1129. Delete's all old (already read) mail.
  1130. X.PP
  1131. Because action is taken on mail messages, not files,
  1132. metacharacters such as `*' and `?' are not expanded to file names as
  1133. X.I csh
  1134. would do.
  1135. Instead,
  1136. X.I Mush
  1137. commands take
  1138. X.I "message lists"
  1139. as arguments (a list references one or messages) to take action upon.
  1140. To reference message numbers,
  1141. X.I Mush
  1142. understands the following special syntax:
  1143. X.sp
  1144. X.in +2
  1145. X.nf
  1146. X.ta 1.0i
  1147. X*    All messages
  1148. X^    The first message
  1149. X$    The last message
  1150. X\&.    The current message
  1151. N-M    A range of messages between N and M
  1152. X.sp
  1153. X.fi
  1154. X.in -2
  1155. In the last case, N and M may be * ^ $ . or digits referencing
  1156. explicit message numbers.
  1157. The range must be in ascending order.
  1158. X.sp
  1159. You can also negate messages by placing the message list inside
  1160. braces, `{' `}' \*- thus, the expression \*Q2-19 {11-14}\*U references
  1161. messages 2 through 19 except for messages 11 through 14.
  1162. X.sp
  1163. Note that message lists are parsed left to right.
  1164. Negated messages may be reset by turning them on
  1165. again later in the argument list.
  1166. A common error new users make is to specify a negated list without
  1167. specifying any beginning messages.
  1168. X.sp
  1169. X.ti +2
  1170. delete { 6 }
  1171. X.sp
  1172. In this example, the user attempted to delete all messages
  1173. except for number 6.
  1174. He should have specified `*' beforehand.
  1175. A correct example:
  1176. X.sp
  1177. X.ti +2
  1178. preserve ^-. { 3 }
  1179. X.sp
  1180. Here, the user specifies a valid message list and causes
  1181. X.I Mush
  1182. to preserve all messages from the beginning of the list (message 1)
  1183. to the current message, excluding message 3.
  1184. X.PP
  1185. As discussed, after the command line is parsed, the command given is
  1186. called and the rest of the arguments on the command line are passed to it.
  1187. If no
  1188. X.I Mush
  1189. command has been found that matches the one given, then the variable
  1190. X.B unix
  1191. is checked.
  1192. If it is set,
  1193. X.I Mush
  1194. attempts to run the command line as a
  1195. X.I UNIX
  1196. command.
  1197. X.PP
  1198. If
  1199. X.I unix
  1200. it is not set, or if the command could not be found in the user's PATH
  1201. environment, a message will be printed indicating that the command was
  1202. not found.
  1203. X.PP
  1204. Since no \*Qmessages\*U are affected by
  1205. X.I UNIX
  1206. commands, piping is disallowed either to or from such commands.
  1207. If the user wishes to execute
  1208. X.I UNIX
  1209. commands which are to be piped to one another (or use any sort of redirection),
  1210. the command,
  1211. X.B sh
  1212. is provided for such purposes.
  1213. Since
  1214. X.I Mush
  1215. will parse the entire command line, caution should be taken to enclose
  1216. questionable shell variables or metacharacters with quotes to prevent
  1217. X.I Mush
  1218. from expanding them.
  1219. END_OF_FILE
  1220. if test 33606 -ne `wc -c <'mush.1.a'`; then
  1221.     echo shar: \"'mush.1.a'\" unpacked with wrong size!
  1222. fi
  1223. # end of 'mush.1.a'
  1224. fi
  1225. echo shar: End of archive 11 \(of 14\).
  1226. cp /dev/null ark11isdone
  1227. MISSING=""
  1228. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
  1229.     if test ! -f ark${I}isdone ; then
  1230.     MISSING="${MISSING} ${I}"
  1231.     fi
  1232. done
  1233. if test "${MISSING}" = "" ; then
  1234.     echo You have unpacked all 14 archives.
  1235.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1236. else
  1237.     echo You still need to unpack the following archives:
  1238.     echo "        " ${MISSING}
  1239. fi
  1240. ##  End of shell archive.
  1241. exit 0
  1242.